#version 330 core
out vec4 FragColor;

uniform vec3 lightColor;
uniform vec3 lightPos;

uniform sampler2D texture_diffuse1;

in vec3 whatNormal;
in vec3 FragPos;
in vec2 TexCoords;

void main()
{
	vec3 objectColor = texture(texture_diffuse1,TexCoords).xyz;
	float ambientStrength = 0.1;
	vec3 ambient = ambientStrength * lightColor;
	vec3 normal_1 = normalize(whatNormal);
	vec3 lightDir = normalize(lightPos - FragPos);
	float diffuseValue = max(dot(normal_1,lightDir),0.0);
	vec3 finalColor = (ambient + objectColor * diffuseValue);// * objectColor;
	FragColor = vec4(finalColor,1.0);
}